//
//  EventListCell.m
//  whopaidforit
//
//  Created by Hoang Vu on 1/27/13.
//  Copyright (c) 2013 Hoang Vu. All rights reserved.
//

#import "EventListCell.h"

@implementation EventListCell

@synthesize imageTitle, title;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier status:(int) status
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        title = [[UILabel alloc] initWithFrame:CGRectMake(50, 9, 190, 21)];
        title.backgroundColor = [UIColor clearColor];
        [title setTextColor:[UIColor colorWithRed:0.247 green:0.243 blue:0.243 alpha:1.0]];
        [self.contentView addSubview:title];
        imageTitle = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 30, 30)];
        UIImage *image = [UIImage imageNamed:@"event.png"];
        imageTitle.image = image;
        [self.contentView addSubview:imageTitle];
        UIView *bgView = [[UIView alloc] init];
        [bgView setBackgroundColor:[UIColor colorWithRed:0.239 green:0.376 blue:0.69 alpha:1.0]];
        [self setSelectedBackgroundView:bgView];
        [bgView release];
        self.title.highlightedTextColor = [UIColor whiteColor];
        if(status==0){
            self.title.text = [NSString stringWithFormat:NSLocalizedString(@"event.overview", @"")];
            image = [UIImage imageNamed:@"round.png"];
            imageTitle.image = image;
        }else if(status==2){
            self.title.text = [NSString stringWithFormat:NSLocalizedString(@"event.add", @"")];
            image = [UIImage imageNamed:@"plus.png"];
            imageTitle.image = image;
            self.title.textColor = [UIColor colorWithRed:0.557 green:0.549 blue:0.549 alpha:1.0];
        }
        if(status !=2){
            [StyleControl drawLine:self.contentView PositionX:0 PositionY:44 Width:320];
        }
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
